<template>
	<view class="question">
		<view class="top">
			<image src="/static/icon/white-back.png" @tap="nav" />
			<view>选择售后类型</view>
		</view>
		<view class="bg1"></view>
		<view class="questionItem">
			<view class="title">房间信息</view>
			<view class="item">{{ userdata.room }}</view>
			<view class="item">{{ userdata.roomtype }}</view>
		</view>
		<view class="bg2"></view>
		<view class="questionItem">
			<view class="title">服务人员</view>
			<view class="item">清洁人员: {{ userdata.name }}</view>
			<view class="item">联系电话: {{ userdata.phone }}</view>
		</view>
		<view class="bg3"></view>
		<view class="questionType">
			<view class="title">选择售后类型</view>
			<view class="item" @tap="afterSale(['clean', '重新打扫'])">
				<view class="left">
					<image src="/static/icon/dasao.png" mode=""></image>
					<view>重新打扫</view>
				</view>
				<view class="right">
					<view>再次打扫该房间</view>
					<image src="/static/icon/right.png" mode=""></image>
				</view>
			</view>
			<view class="item" @tap="afterSale(['refund', '退款'])">
				<view class="left">
					<image src="/static/icon/tuikuan.png" mode=""></image>
					<view>退款</view>
				</view>
				<view class="right">
					<view>退还该订单金额</view>
					<image src="/static/icon/right.png" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			userdata: {},
			id: ''
		};
	},
	onLoad(e) {
		this.id = e.id;
		this.getReq({
			url: 'both/feedback/create',
			data: {
				status_id: e.id
			}
		}).then(res => {
			let info = res[1].data.data.info;
			this.id = info.order_id;
			this.userdata = {
				room: info.order.room_no + info.order.room_type + '\u0020' + info.order.storey + ' 楼',
				roomtype: info.order.room_type_format + '\u0020' + info.order.real_amount + ' 元',
				name: info.cleaner.name,
				phone: info.account.phone
			};
		});
	},
	methods: {
		nav() {
			uni.navigateBack();
		},
		afterSale([type, title]) {
			uni.navigateTo({
				url: '/pages/hotel/service/question2?title=' + title + '&type=' + type + '&id=' + this.id
			});
		}
	}
};
</script>

<style scoped lang="scss">
.question {
	color: #333333;
	min-height: 100vh;
	background-color: #f8f8f8;
	.top {
		width: 750upx;
		padding-top: var(--status-bar-height);
		height: 86upx;
		background-color: #3595f9;
		position: fixed;
		left: 0;
		top: 0;
		font-size: 36upx;
		color: #fff;
		text-align: center;
		line-height: 86upx;
		image {
			position: absolute;
			width: 32upx;
			height: 32upx;
			left: 27upx;
			bottom: 27upx;
		}
	}
	.bg1 {
		width: 100%;
		padding-top: var(--status-bar-height);
		height: 86upx;
	}
	.bg2 {
		width: 100%;
		height: 20upx;
	}
	.bg3 {
		width: 100%;
		height: 30upx;
	}
	.questionItem {
		background: #fff;
		width: 100%;
		padding: 30upx 24upx 20upx 24upx;
		box-sizing: border-box;
		height: 230upx;
		.title {
			font-size: 32upx;
			line-height: 70upx;
		}
		.item {
			font-size: 28upx;
			line-height: 48upx;
		}
	}
	.questionType {
		background: #fff;
		width: 100%;
		padding: 0 24upx;
		box-sizing: border-box;
		.title {
			font-size: 32upx;
			line-height: 90upx;
		}
		.item {
			width: 702upx;
			height: 100upx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.left {
				display: flex;
				align-items: center;
				font-size: 32upx;
				image {
					width: 40upx;
					height: 40upx;
					margin-right: 20upx;
				}
			}
			.right {
				display: flex;
				align-items: center;
				font-size: 24upx;
				color: #999999;
				image {
					width: 26upx;
					height: 26upx;
				}
			}
		}
	}
}
</style>
